package com.tmc.dao.impl.inthotel;

import java.util.List;

import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import com.tmc.bean.inthotel.hotel.HotelOrder;
import com.tmc.dao.impl.BaseDaoImpl;

@Repository
public class HotelOrderDaoImpl extends BaseDaoImpl {

	public void saveHotelOrder(HotelOrder hotelOrder){
		Session session = getSession();
		session.beginTransaction();
		session.save(hotelOrder);
		session.getTransaction().commit();
	}
	
	public void updateHotelOrder(HotelOrder hotelOrder){
		Session session = getSession();
		session.beginTransaction();
		session.save(hotelOrder);
		session.getTransaction().commit();
	}
	
	public void saveAllHotelOrder(List<HotelOrder> hotelOrders){
		Session session = getSession();
    	session.beginTransaction();
    	for (HotelOrder hotelOrder : hotelOrders) {
    		session.update(hotelOrder);
		}
		session.getTransaction().commit();
	}
	
	public void updateAllHotelOrder(List<HotelOrder> hotelOrders){
		Session session = getSession();
    	session.beginTransaction();
    	for (HotelOrder hotelOrder : hotelOrders) {
    		session.update(hotelOrder);
		}
		session.getTransaction().commit();
	}
	
}
